<?php

namespace app\admin\model\sum;

use think\Model;
use traits\model\SoftDelete;

class Richtext extends Model
{
    use SoftDelete;

    // 表名
    protected $name = 'sum_richtext';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];

    public function getTypeList()
    {
        return [
            'normal' => __('Normal'),
            'system' => __('System'),
            'activity' => __('Activity'),
            'tip' => __('Tip')
        ];
    }

    public function getSlugList()
    {
        return [
            'tip_service_rule' => __('Tip ServiceRule'),
            'tip_invite_rule' => __('Tip InviteRule'),
            'tip_price_rule' => __('Tip PriceRule'),
            'tip_litre_rule' => __('Tip LitreRule'),
            'tip_invoicing_note' => __('Tip Invoicing Note'),
            'tip_invoicing_content_1' => __('Tip Invoicing Content 1'),
            'tip_invoicing_content_2' => __('Tip Invoicing Content 2'),
            'tip_refund' => __('Tip Refund'),
            'tip_daijihuo_rule' => __('Tip DaijihuoRule'),
            'tip_tyyp_rule' => __('Tip TyypRule'),
        ];
    }


    public function getTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
        $list = $this->getTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }
    

    







}
